hysop.operator.analytic module

Initialize fields on a grid, with a user-defined function

class hysop.operator.analytic.AnalyticField(field, formula, variables, extra_input_kwds=None, implementation=None, base_kwds=None, **kwds)[source]

Bases: ComputationalGraphNodeGenerator

Applies an analytic formula, given by user, on all contained scalar fields. Formula may be given in different formats depending on the chosen implementation backend.

AnalyticField operator frontend.

Apply a user-defined formula onto a field, possibly dependent on space variables and external fields/parameters.

Parameters:
  • field (hysop.field.continuous_field.Field) – Continuous field to be modified.

  • formula (python function or sympy expression or tupe) – The formula to be applied onto the scalar fields. If the formula is a tuple of the length of the number of scalar fields, fomula[component] is used instead.

  • variables (dict) – Dictionary of fields as keys and topology descriptors as values.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • extra_input_kwds (dict, optional) – Extra inputs that will be forwarded to the formula. Fields and Parameters are handled correctly as input requirements. Only used for Implementation.PYTHON, discarded for other implementations.

  • base_kwds (dict, optional) – Base class keyword arguments.

  • kwds (dict, optional) – Extra parameters passed towards operator implementation.

class hysop.operator.analytic.AnalyticScalarField(implementation=None, base_kwds=None, candidate_input_tensors=None, candidate_output_tensors=None, **impl_kwds)[source]

Bases: ComputationalGraphNodeFrontend

Applies an analytic formula, given by user, on its field. Formula may be given in different formats depending on the chosen implementation backend.

AnalyticField operator frontend.

Apply a user-defined formula onto a field, possibly dependent on space variables and external fields/parameters.

Parameters:
  • field (hysop.field.continuous_field.Field) – Continuous field to be modified.

  • formula (python function or sympy expression) – The formula to be applied onto the field.

  • variables (dict) – Dictionary of fields as keys and topology descriptors as values.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • extra_input_kwds (dict, optional) – Extra inputs that will be forwarded to the formula. Fields and Parameters are handled correctly as input requirements. Only used for Implementation.PYTHON, discarded for other implementations.

  • base_kwds (dict, optional) – Base class keyword arguments.

  • kwds (dict, optional) – Extra parameters passed towards operator implementation.

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.